package com.wisezone.java1902.d13_sort1;

import java.util.Set;
import java.util.TreeSet;

public class TestTressetUser {

	public static void main(String[] args) {
		User user1 = new User("小明",22);
		User user2 = new User("小丽",23);
		User user3 = new User("张三",21);
		User user4 = new User("李四",20);
		
		Set<User> userSets = new TreeSet<User>();
		userSets.add(user1);
		userSets.add(user2);
		userSets.add(user3);
		userSets.add(user4);
		
		for (User user : userSets) {
			System.out.println(user);
		}

	}

}
